﻿using System.Collections;
using Eneta.Portal.Forum.Core.Domain.Entities;

namespace Eneta.Portal.Forum.Core.Domain.Collections
{
    public class MessageCollection : CollectionBase
    {
        // Methods
        public int Add(Message message)
        {
            return List.Add(message);
        }

        public void Sort(string sortPropertyName, SortDirection sortDirection)
        {
            InnerList.Sort(new UniversalSorter(sortPropertyName, sortDirection));
        }

        // Properties
        public Message this[int index]
        {
            get
            {
                return (Message)List[index];
            }
            set
            {
                List[index] = value;
            }
        }
    }
}
